<!DOCTYPE html>
<html lang="zh"  xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>登录页面 </title>
<link rel="icon" href="favicon.ico" type="/behindstatic/image/ico">
<meta name="keywords" content="非遗数字文化云">
<meta name="description" content="LightYear是一个基于Bootstrap v3.3.7的后台管理系统的HTML模板。">
<meta name="author" content="yinqi">
<link href="/behindstatic/css/bootstrap.min.css" rel="stylesheet">
<link href="/behindstatic/css/materialdesignicons.min.css" rel="stylesheet">
<link href="/behindstatic/css/style.min.css" rel="stylesheet">
<style>
body {
    display: -webkit-box;
    display: flex;
    -webkit-box-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    align-items: center;
    height: 100%;
    background-size: cover;
    background-image: url(/behindstatic/images/bei.jpg); /*背景图位置*/
}
p{
  font-size: 30px;
  text-align: center;
}
form{
  width: 330px;
}
.login-box {
    display: table;
    table-layout: fixed;
    overflow: hidden;
    max-width: 700px;
}
.login-left {
    display: table-cell;
    position: relative;
    margin-bottom: 0;
    border-width: 0;
    padding: 80px;
}
.login-left .form-group:last-child {
    margin-bottom: 0px;
}
.login-box .has-feedback.feedback-left .form-control {
    padding-left: 38px;
    padding-right: 12px;
}
.login-box .has-feedback.feedback-left .form-control-feedback {
    left: 0;
    right: auto;
    width: 38px;
    height: 38px;
    line-height: 38px;
    z-index: 4;
    color: #dcdcdc;
}
.login-box .has-feedback.feedback-left.row .form-control-feedback {
    left: 15px;
}
@media (max-width: 576px) {
  .login-right {
      display: none;
  }   
}
</style>
</head>

<body>
<div class="bg-translucent p-10"  id="app">
  <div class="login-box bg-white clearfix">
    <div class="login-left">
      <p   th:text="${type} == 1 ? '医生后台' : '管理员后台'"></p>
    
      <form id="form" action="/login/verificatio" >
        <input type="hidden"  th:value="${type}" name="type">
        <div class="form-group has-feedback feedback-left">
          <input  v-model="username"  type="text" placeholder="请输入账号" class="form-control" name="username" id="username"  />
          <span class="mdi mdi-account form-control-feedback" aria-hidden="true"></span>
        </div>
        <div class="form-group has-feedback feedback-left">
          <input   v-model="password" type="password" placeholder="请输入密码" class="form-control"  name="password"   id="password"/>
          <span class="mdi mdi-lock form-control-feedback" aria-hidden="true"></span>
        </div>
        <div class="form-group"  style="text-align: right;">
                <a  th:if="${type == 1}" href="/login/afterView?type=2">切换管理员登录</a>
                <a  th:if="${type == 2}" href="/login/afterView?type=1">切换医生登录</a>
        </div>
        <div class="form-group">
          <button  type="button"   @click="login()"  class="btn btn-block btn-primary" >立即登录</button>
        </div>
        <div   class="form-group" style="text-align: right;margin-bottom: -19px;">
               <a   th:if="${type == 1}"   th:href="@{/login/doctorRegisterPage(type=1)}" style="color:#1c37ba;">立即注册</a>
               <a   th:if="${type == 2}"   th:href="@{/login/mimaPageUptate(type=2)}" style="color:#1c37ba;">立即注册</a></div>
      </form>
    </div>
  </div>
</div>
<script type="text/javascript" src="/behindstatic/js/jquery.min.js"></script>
<script type="text/javascript" src="/behindstatic/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/behindstatic/js/vue.js"></script>
<script type="text/javascript">
    new Vue({
      el: '#app',
      data: {
        username: '',
        password: ''
      },
      methods: {
          login: function (){
              if(this.username == null ||  this.username == ""){
                alert("账号不能为空")
                return;
              }
              if(this.password == null ||  this.password == ""){
                alert("密码不能为空");
                return;
              }
             document.getElementById("form").submit();
          }

      }
    })
    var message  ='[[${message}]]';
    if(message != null && message != ''){
      alert(message);
    }
</script>
</body>
</html>